import React, { Component } from 'react';
import './people-home.scss';
import { HashRouter, Route, Link,Redirect } from 'react-router-dom'
import $ from 'jquery'
import {
    UserOutlined,
    RightOutlined
} from '@ant-design/icons';
import { message } from 'antd';
import Foot from '../../components3/foot/foot'
import Nav from '../nav/nav.jsx'
import Mimaxg from './mimaxg.jsx'
import Address from './address.jsx'
import Addaddress from './addAddress.jsx'
import Userinfo from './userinfo.jsx'
import Phonehb from './phonexg.jsx'
import Myorder from './myorder.jsx'
import Comment from './comment.jsx'
import Myorderlist from './myorderlist.jsx'
import Orderdetail from './orderdetail.jsx'
import Myjifen from './myjifen.jsx'
import Duihuanjilu from './duihuanjilu.jsx'
import Mycollect from './mycollect.jsx'
import Zuijinliulan from './zuijinliulan.jsx'
import Mymessage from './mymessage.jsx'
import Mymessagedetail from './mymessagedetail.jsx'
import Myzhanghu from './myzhanghu.jsx'
import Chongzhi from './chongzhi.jsx'
class home extends Component {
    componentDidMount(){
        $('dd>a').click(function(){
            $('dl.center a').removeClass('click');
            $(this).addClass('click');
        })
        if(!localStorage.getItem('user_info')){
            message.error('请先登录');
            this.props.history.push('/loginmima');
        }
    }
    render() {
        return (
            <div className="people-home-main">
                <Nav  history={this.props.history}/>
                <div className="people-home container">
                    <div className="people-home-l">
                    <div>
                    <p className="center">
                    <UserOutlined />&nbsp;&nbsp;
                    <span>个人中心</span>
                    </p>
                    </div>
                    <dl className="center">
                        <dt>
                            <span>交易管理</span>
                            <RightOutlined />
                        </dt>
                        <dd>
                            <Link to="/people/myzhanghu">我的账户</Link>
                        </dd>
                        <dd>
                            <Link to="/people/myorderlist">我的订单</Link>
                        </dd>
                        <dd>
                            <Link to="/people/myjifen">我的积分</Link>
                        </dd>
                        <dd>
                            <Link to="###">我的宜和券</Link>
                        </dd>
                    </dl>
                    <dl className="center">
                        <dt>
                            <span>会员资料</span>
                            <RightOutlined />
                        </dt>
                        <dd>
                            <Link to="/people/userinfo">个人资料</Link>
                        </dd>
                        <dd>
                            <Link to="/people/address">地址管理</Link>
                        </dd>
                        <dd>
                            <Link to="/people/mycollect">我的收藏</Link>
                        </dd>
                        <dd>
                            <Link to="/people/zuijinliulan">最近浏览</Link>
                        </dd>
                        <dd>
                            <Link to="/people/mimaxg">修改密码</Link>
                        </dd>
                    </dl>
                    <dl className="center">
                        <dt>
                            <span>站内信</span>
                            <RightOutlined />
                        </dt>
                        <dd>
                            <Link to="/people/mymessage">我的消息</Link>
                        </dd>
                    </dl>
                </div>
                    <div className="people-home-r">
                <HashRouter>
                <Redirect path="/people" to="/people/myzhanghu" /> 
                <Route path='/people/mimaxg' component={Mimaxg}></Route>
                <Route path='/people/address' component={Address}></Route>
                <Route path='/people/addAddress' component={Addaddress}></Route>
                <Route path='/people/userinfo' component={Userinfo}></Route>
                <Route path='/people/phonehb' component={Phonehb}></Route>
                <Route path='/people/myorder' component={Myorder}></Route>
                <Route path='/people/comment' component={Comment}></Route>
                <Route path='/people/myorderlist' component={Myorderlist}></Route>
                <Route path='/people/orderdetail' component={Orderdetail}></Route>
                <Route path='/people/myjifen' component={Myjifen}></Route>
                <Route path='/people/duihuanjilu' component={Duihuanjilu}></Route>
                <Route path='/people/mycollect' component={Mycollect}></Route>
                <Route path='/people/zuijinliulan' component={Zuijinliulan}></Route>
                <Route path='/people/mymessage' component={Mymessage}></Route>
                <Route path='/people/mymessagedetail' component={Mymessagedetail}></Route>
                <Route path='/people/myzhanghu' component={Myzhanghu}></Route>
                <Route path='/people/chongzhi' component={Chongzhi}></Route>
                </HashRouter>
                </div>
                </div>
                <Foot/>
            </div>
        );
    }
}

export default home;